// 当前环境
const ENV = process.env.NODE_ENV
// 基本请求
let _BASE_URL = ''
// 搜索模块链接
let _SEARCH_URL = ''
// 供应链地址
let _BASE_URL_G = ''
// 正式环境的链接
let _BG_URL = ''
let _PREV_BASE_URL = ''
let _NSH_URL = ''

// 当前环境判断 测试环境
if (ENV == 'development' || ENV == 'preannouncement') {
  // _BASE_URL = 'http://218.94.47.138:8905/TermireMall/'
  _BASE_URL = 'http://192.168.2.24:8081/TermireMall/'
  _SEARCH_URL = 'http://218.94.47.138:8905/MallLucene/'
  _BG_URL = 'http://218.94.47.138:8902'
  _PREV_BASE_URL = 'http://218.94.47.138:8906/HaoXiaDanStoreBgApi/'
  _BASE_URL_G = 'http://192.168.2.17:7080/FinanceChain_v2/api/'
  _NSH_URL = 'http://60.190.244.46:8006/paygate/main'
} else if (ENV == 'production') {
  // 生产环境
  _BASE_URL = 'https://api.haoxiadan.cn/MallApi/'
  _SEARCH_URL = 'https://api.haoxiadan.cn/Lucene/'
  _PREV_BASE_URL = 'https://api.haoxiadan.cn/MallApi/'
  _BASE_URL_G = 'http://116.62.197.248:8018/finance/api/'
  _BG_URL = 'http://shop.haoxiadan.cn'
  _NSH_URL = 'https://epay1.zj96596.com/paygate/main'
}

export const BASE_URL = _BASE_URL
export const SEARCH_URL = _SEARCH_URL
export const BASE_URL_G = _BASE_URL_G
export const BG_URL = _BG_URL

// 接口请求地址
export const API = `${BASE_URL}api/h5/v2/`
// v3版本：部分发货，退款
export const API3 = `${BASE_URL}api/h5/v3/`
export const API1 = `${BASE_URL}api/h5/v1/`
export const PREV_API = `${_PREV_BASE_URL}api/web/store/v3/`
export const SEARCH_API = `${SEARCH_URL}api/h5/v2/`
export const HOT_API = `${_BASE_URL}api/h5/v1/`
export const NSH_URL = _NSH_URL

// 图片上传地址
export const imgUploadUrl = `${API}Img/ImgSwfUpload`

// 加密的秘钥
export const KEY = 'HAOXIADANURLKEY'

// 配置订单状态
export const ORDER_STATUS = {
  0: '订单取消',
  10: '待付款',
  16: '货到付款',
  20: '待发货',
  21: '退款中',
  22: '退款审核中',
  25: '已退款',
  30: '待收货',
  40: '已收货',
  41: '退货申请中',
  42: '退货审核中',
  45: '退货完成',
  50: '已评价',
  60: '已结束',
  65: '订单不可评价'
}

// 用户角色
export const USER_ROLE = {
  'BUYER': 'BUYER', // 买家
  'SELLER': 'SELLER', // 商家
  'CUSTOMER': 'CUSTOMER' // 平台客服
}